/**
 * 
 */
package com.bolbachchan.blog.form.posts;

import com.bolbachchan.blog.hibernate.domain.Posts;
import com.bolbachchan.blog.hibernate.domain.UserDetails;

/**
 * @author Chaitanya
 * 
 */
public class NewPostForm {

    private Posts post;

    /**
     * @return the post
     */
    public Posts getPost() {
	if (post == null) {
	    post = new Posts();
	}
	return post;
    }

    /**
     * @param post
     *            the post to set
     */
    public void setPost(Posts post) {
	this.post = post;
    }

    /**
     * @return
     */
    public String getPostTitle() {
	return getPost().getPostTitle();
    }

    /**
     * @param newPostTitle
     */
    public void setPostTitle(String postTitle) {
	getPost().setPostTitle(postTitle);
    }

    /**
     * @return
     */
    public String getPostContent() {
	return getPost().getPostContent();
    }

    /**
     * @param newPostContent
     */
    public void setPostContent(String postContent) {
	getPost().setPostContent(postContent);
    }

    /**
     * @return
     */
    public int getUserObjId() {
	return getPost().getUserDetails().getObjId();
    }

    /**
     * @param userObjId
     */
    public void setUserObjId(int userObjId) {
	getPost().setUserDetails(new UserDetails(userObjId));
    }
}
